#include "task.hxx"
#include "captchaaction.hxx"

CaptchaAction::CaptchaAction(Task* owner)
: Action(owner)
{}
char* CaptchaAction::GetCaptcha(size_t& size) const
{
	const_cast<CaptchaAction*>(this)->PreAction();

	return Owner->GetCaptcha(size);
}
Action::ActionResult CaptchaAction::SetCaptcha(const string& captcha)
{
	ActionRes = Owner->SetCaptcha(captcha) ? Action::ACTION_RESULT_SUCCEEDED : Action::ACTION_RESULT_CAPTCHA_WRONG;

	AfterAction();

	return ActionRes;
}
